package com.gis.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;

@Data
@Schema(description = "颜色映射条目")
public class ColorMapEntry {
    @NotBlank
    @Schema(description = "颜色值", example = "#FF0000")
    String color;

    @Schema(description = "数值", example = "1.0")
    @NotBlank
    String quantity;

    @Schema(description = "标签", example = "Red")
    String label;

    @NotBlank
    @Schema(description = "不透明度", example = "1.0")
    String opacity;

    @Override
    public String toString() {
        return "<sld:ColorMapEntry color=\"" + color + "\" quantity=\"" + quantity + "\" label=\"" + label + "\" opacity=\"" + opacity + "\"/>\r\n";
    }

}
